package PTA.javaA;

import java.util.ArrayList;
import java.util.Scanner;

public class fn02 {
    public static  void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //这边是你的代码
        int n= sc.nextInt();
       Object a[] = new Object[n];
        for(int i=0;i<n;i++){
            String str = sc.next();
            char c = str.charAt(0);
            if(c=='c'){

            }else if(c=='d'){
                double b= sc.nextDouble();
                a[i]=b;
            }else if(c=='i'){
                int t= sc.nextInt();
                a[i]=t;
            }else if (c=='s'){
                String s = sc.next();
                a[i]=s;
            }else{
                a[i]=null;
            }

        }
        for(int i=n-1;i>=0;i--){
            if(a[i]!=null){
                System.out.println(a[i]);
            }
        }



        sc.close();
    }

}
